﻿using System.Drawing;
using System.Globalization;
using System.Windows.Data;

namespace CoreModule.Converters
{
    /// <summary>
    /// 
    /// </summary>
    public class BooleanToSolidColorBrushConverter : IValueConverter
    {

        /// <summary>
        /// 
        /// </summary>

        public System.Windows.Media.SolidColorBrush TrueValue { get; set; } = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Red) ;

        /// <summary>
        /// 
        /// </summary>
        public System.Windows.Media.SolidColorBrush FlaseValue { get; set; } = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Black);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="value"></param>
        /// <param name="targetType"></param>
        /// <param name="parameter"></param>
        /// <param name="culture"></param>
        /// <returns></returns>
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
            {
                return TrueValue;
            }
            return (bool)value ? TrueValue : FlaseValue;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
